home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 42
/
Amiga Format AFCD42 (Issue 126, Aug 1999).iso
/
-coverdisks-
/
126a
/
football
/
user
/
reformat_schedule.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-05-22
|
1KB
|
42 lines
/* */
parse arg filen year1 year2
say "This program formats a schedule file from DDMM to DDMMYYYY."
say "Working..."
filen = strip(filen)
year1 = strip(year1)
year2 = strip(year2)
if open(datafile,filen".schd",'r') then do
if open(datafile2,filen".schd2",'w') then do
do while ~eof(datafile)
line = readln(datafile)
if line ~= '' & pos('*',line) = 0 then do
counter = words(line)
do i=1 to counter
sdate = word(line,i)
mnth = substr(sdate,3,2)
if mnth > 7 then
sdate = sdate||year1" "
else do
if mnth < 7 & mnth ~= 0 then
sdate = sdate||year2" "
else
sdate = sdate||"0000 "
end
writech(datafile2,sdate)
end
writeln(datafile2,"")
end
else if pos('*',line) > 0 then
writeln(datafile2,line)
end
close(datafile2)
end
close(datafile)
end
say "New schedule file is "filen".schd2."
exit